/**
 * 
 */
package sqs.model;

import java.io.Serializable;
import java.util.List;

import sqs.exception.FeatureNotAvailableException;

/**
 * @author kjleng
 *
 */
public abstract class Question implements Serializable{
	private int questionId;
	private String questionText;
	//optional by defaulted
	private String mandatory=Question.OPTIONAL;
	protected boolean answered=false;
	
	public static final String MANDATORY="M";
	public static final String OPTIONAL="O";
	
	public boolean equals(Question q){
		if(q.getQuestionId()==this.getQuestionId()){
			return true;
		}
		return false;
	}
	
	public boolean isCompuslory(){
		if(this.mandatory.equals(Question.MANDATORY)){
			return true;
		}
		return false;
	}
	
	
	public boolean isAnswered(){
		return answered;
	}
	
	public int getQuestionId() {
		return questionId;
	}
	public void setQuestionId(int questionId) {
		this.questionId = questionId;
	}
	public String getQuestionText() {
		return questionText;
	}
	public void setQuestionText(String questionText) {
		this.questionText = questionText;
	}
	public String getMandatory() {
		return mandatory;
	}
	public void setMandatory(String mandatory) {
		this.mandatory = mandatory;
	}
	
	public abstract void addAnswer(Answer ans);
	public abstract Answer getAnswer();
	public abstract List getOptions();
	public abstract void setOptions(List<Option> options);
	public abstract Option createOption();
	public abstract String getLayout();
	public abstract void setLayout(String layout);
	public abstract Scale createScale();
	
	
}
